package com.example.my.meila.api;

import rx.Subscriber;


public abstract class BaseSubscriber<T> extends Subscriber<T> {

    public abstract void onSuccess(T t);

    public abstract void onFail(ExceptionHandle.ResponeThrowable e);

    public abstract void onFinished();

    @Override
    public void onCompleted() {
        onFinished();

    }

    @Override
    public void onError(Throwable e) {
        onFail(ExceptionHandle.handleException(e));
    }

    @Override
    public void onNext(T t) {
        onSuccess(t);
    }


}
